package com.itheima.test;
/*
Math类
 */
public class Demo01 {

    public static void main(String[] args) {
       //public static int   abs(int a)
        //返回参数的绝对值
        int a = Math.abs(-10);
        int b = Math.abs(10);
        System.out.println(a);
        System.out.println(b);
        //public static double ceil(double a)
        //返回大于或等于参数的最小double值，等于一个整数  天花板数
        double c = Math.ceil(10.5);
        double d = Math.ceil(10.2);
        System.out.println(c);
        System.out.println(d);
        //public static double floor(double a)
        //返回小于或等于参数的最大double值，等于一个整数 地板数
        double e = Math.floor(10.5);
        double f = Math.floor(10.2);
        System.out.println(e);
        System.out.println(f);

        //public   static int round(float a)
        //按照四舍五入返回最接近参数的int
        System.out.println(Math.round(10.5));
        System.out.println(Math.round(10.2));
        //public static int   max(int a,int b)
        //返回两个int值中的较大值
        //public   static int min(int a,int b)
        //返回两个int值中的较小值
        //public   static double pow (double a,double b)
        //返回a的b次幂的值  a^b
        System.out.println(Math.pow(5, 3));


        //public   static double random()
        //返回值为double的正值，[0.0,1.0)
        System.out.println(Math.random());
        //0-10
        System.out.println(Math.random() * 10);

        //5-10
        for (int i = 0; i < 10; i++) {

         System.out.println(Math.random() * 5 + 5);
        }
    }
}
